import jwt
from django.conf import settings


def generate_jwt(payload):
    """生成token"""

    token = jwt.encode(payload=payload, key=settings.SECRET_KEY)
    # 转化bytes为字符串
    print(type(token))
    return token
